/**
 * Created by zzc on 2017/12/13
 */


'use strict'

import React from 'react';

import {
    View,
    Text,
    ActivityIndicator,
    StyleSheet
} from 'react-native';
import {deviceHeight, deviceWidth} from "../util/ScreenUtil";
import { AppStyles, AppSizes,AppColors} from '@theme/';

export class LoadingView extends React.Component {

    constructor(props) {
        super(props);
    }

    render() {
        let hasHint = this.props.loadingHint && (this.props.loadingHint !== "");
        let nowTime = (new Date()).valueOf();
        console.log("*****renderLoadingView******"+nowTime)
        return (
            <View style={[styles.loading, AppStyles.appContainer]}>
                <ActivityIndicator animating={true} size="large" />
                {hasHint ?
                    <Text style={[styles.loadingTitle, this.props.hintStyle]}>{this.props.loadingHint}</Text> : null}
            </View>
        )
    }

}

const styles = StyleSheet.create({
    loading: {
        height: 100,
        width: 100,
        borderRadius: 10,
        justifyContent: 'center',
        alignItems: 'center',
        position: 'absolute',
        top: (deviceHeight - 90 - 70 - 80) / 2,
        left: (deviceWidth - 100) / 2,
    },
    loadingTitle: {
        marginTop: 10,
        fontSize: 14,
        color: 'white'
    }
});